package jspx.example.view;

import com.github.jspxnet.txweb.annotation.Operate;
import com.github.jspxnet.txweb.dispatcher.Dispatcher;
import com.github.jspxnet.txweb.support.ActionSupport;
import com.github.jspxnet.txweb.util.RequestUtil;
import com.github.jspxnet.utils.ArrayUtil;
import com.github.jspxnet.utils.BeanUtil;
import com.github.jspxnet.utils.ObjectUtil;
import com.github.jspxnet.utils.StringUtil;

import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Array;
import java.nio.charset.StandardCharsets;
import java.util.Enumeration;


public class TestView extends ActionSupport {

    @Operate
    @Override
    public String execute() throws Exception {
        HttpServletRequest request = getRequest();

        System.out.println("-------------------------------");

        Enumeration<String> enu = (Enumeration<String>) BeanUtil.getProperty(request, "getParameterNames");
        if (enu==null)
        {
            return null;
        }
        while (enu.hasMoreElements()) {
            String name = enu.nextElement();
            Object values = request.getParameter(name);
            System.out.println(name + "=" + values);
        }

        return getActionResult();
    }
}
